<%--
  Created by IntelliJ IDEA.
  User: jie
  Date: 2020/8/20
  Time: 10:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <title>出库管理</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/toastr/toastr.min.css"/>
    <script src="${pageContext.request.contextPath}/static/js/jquery-3.4.1.min.js" type="text/javascript"
            charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/static/toastr/toastr.min.js" type="text/javascript"
            charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/static/js/bootstrap.min.js" type="text/javascript"
            charset="utf-8"></script>
</head>
<body>
<h3 class="text-center">出库管理</h3>
<div class="form-inline">

        <table>
            <tr>
                <td>
                    <div class="input-group">
                        <label class="input-group-addon">出货时间</label>
                        <input id="startTime" type="date" class="form-control"/>

                        <label class="input-group-addon">至</label>
                        <input id="endTime" type="date" class="form-control"/>

                        <label class="input-group-addon">商品类型</label>
                        <select id="cgsId" class="form-control">
                            <option value="">--请选择--</option>
                            <c:forEach items="${cgs}" var="cg">
                                <option value="${cg.id}">${cg.name}</option>
                            </c:forEach>
                        </select>
                        <label class="input-group-addon">商品名称</label>
                        <select id="goodsId" class="form-control">
                            <option value="">--请选择--</option>
                            <c:forEach items="${goods}" var="good">
                                <option value="${good.id}">${good.name}</option>
                            </c:forEach>
                        </select>
                    </div>
                </td>
                <td>
                    <button type="button" onclick="findPage(1,pageBean.pageSize)" class="btn btn-primary btn-sm">搜索</button>
                    <button class="btn btn-success" data-toggle="modal" data-target="#myModal">添加</button>
                </td>
            </tr>
        </table>
    </div>
<table class="table table-bordered text-center table-responsive table-striped table-hover">
    <thead style="background: #acdef3;text-align-last: center; ">
    <tr>
        <th>索引</th>
        <th>出货单编号</th>
        <th>操作员工</th>
        <th>出货时间</th>
        <th>出货数量</th>
        <th>商品名称</th>
        <th>商品类型</th>
    </tr>
    </thead>
    <tbody id="tb"></tbody>
</table>


<div class="row" id="navBar" style="margin-left: 10px">
    显示第<span id="start"></span>到第<span id="end"></span>条，总共<span id="sum"></span>条记录，每页显示
    <div class="btn-group dropup">
        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span id="count"></span>&nbsp;&nbsp;<span
                class="caret"></span></button>
        <ul class="dropdown-menu" role="menu">
            <li><a href="javascript:findPage(1,5)">5</a></li>
            <li><a href="javascript:findPage(1,10)">10</a></li>
            <li><a href="javascript:findPage(1,50)">50</a></li>
            <li><a href="javascript:findPage(1,100)">100</a></li>
        </ul>
    </div>
    条记录
    <div class="pull-right">
        <nav aria-label="Page navigation">
            <ul id="ctn" class="pagination"></ul>
        </nav>
    </div>
</div>


<!-- 添加出库信息模态框 -->
<form id="addOut" method="post">
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog modal-md" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title" id="myModalLabel1">添加出库信息</h4>
                </div>
                <div class="modal-body form-horizontal">
                    <div class="form-group" style="line-height: 34px;">
                        <label class="col-md-2 col-md-offset-1">员工编号</label>
                        <div class="col-md-4">
                            <input hidden name="staffId" value="${staff.staffId}">
                            <input class="form-control" value="${staff.staffId}" disabled>
                        </div>
                    </div>
                    <div class="form-group text-center" style="line-height: 34px;">
                        <label class="col-md-2 col-md-offset-1">商品名称</label>
                        <div class="col-md-5">
                            <input type="text" id="goodsName" class="form-control">
                            <button type="button" id="search" class="btn btn-xs btn-info">搜索</button>
                            <select name="goodsId" id="goodsAddShow" class="form-control">
                                <c:forEach items="${goods}" var="good">
                                    <option value="${good.id}">${good.name}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>
                    <div class="form-group" style="line-height: 34px;">
                        <label class="col-md-2 col-md-offset-1">出库数量</label>
                        <div class="col-md-4">
                            <input type="text" id="stockCount" onkeyup="value=value.replace(/[^\d]/g,'')" name="count" class="form-control">
                        </div>
                    </div>
                    <div class="form-group" style="line-height: 34px;">
                        <label class="col-md-2 col-md-offset-1">剩余量</label>
                        <div class="col-md-4">
                            <input id="rmng" type="text" disabled class="form-control">
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" id="cancel" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" id="addStock" class="btn btn-primary">确认</button>
                </div>
            </div>
        </div>
    </div>
</form>
<!-- 添加出库信息模态框 -->

<%--<!-- 修改出库信息模态框 -->--%>
<%--<form id="modifyOut" method="post">--%>
<%--    <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">--%>
<%--        <div class="modal-dialog modal-md" role="document">--%>
<%--            <div class="modal-content">--%>
<%--                <div class="modal-header">--%>
<%--                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span--%>
<%--                            aria-hidden="true">&times;</span>--%>
<%--                    </button>--%>
<%--                    <h4 class="modal-title" id="myModalLabel2">修改出库信息</h4>--%>
<%--                </div>--%>
<%--                <div class="modal-body form-horizontal">--%>
<%--                    <div class="form-group" style="line-height: 34px;">--%>
<%--                        <label class="col-md-2 col-md-offset-1">订单编号</label>--%>
<%--                        <div class="col-md-4">--%>
<%--                            <input class="form-control" disabled>--%>
<%--                        </div>--%>
<%--                    </div>--%>
<%--                    <div class="form-group" style="line-height: 34px;">--%>
<%--                        <label class="col-md-2 col-md-offset-1">出货时间</label>--%>
<%--                        <div class="col-md-5">--%>
<%--                            <input disabled type="text" class="form-control">--%>
<%--                        </div>--%>
<%--                    </div>--%>
<%--                    <div class="form-group" style="line-height: 34px;">--%>
<%--                        <label class="col-md-2 col-md-offset-1">出库数量</label>--%>
<%--                        <div class="col-md-4">--%>
<%--                            <input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" name="count" class="form-control">--%>
<%--                        </div>--%>
<%--                    </div>--%>
<%--                    <div class="form-group" style="line-height: 34px;">--%>
<%--                        <label class="col-md-2 col-md-offset-1">商品名称</label>--%>
<%--                        <div class="col-md-4">--%>
<%--                            <input type="text" name="count" disabled class="form-control">--%>
<%--                            <input hidden>--%>
<%--                        </div>--%>
<%--                    </div>--%>
<%--                </div>--%>
<%--                <div class="modal-footer">--%>
<%--                    <button type="button" id="cancel2" class="btn btn-default" data-dismiss="modal">关闭</button>--%>
<%--                    <button type="button" id="confirm2" class="btn btn-primary">确认</button>--%>
<%--                </div>--%>
<%--            </div>--%>
<%--        </div>--%>
<%--    </div>--%>
<%--</form>--%>
<%--<!-- 修改出库信息模态框 -->--%>

<%--<!-- 商品删除提示 -->--%>
<%--<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">--%>
<%--    <div class="modal-dialog modal-sm" role="document">--%>
<%--        <div class="modal-content">--%>
<%--            <div class="modal-header">--%>
<%--                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>--%>
<%--                </button>--%>
<%--                <h5 class="modal-title" id="myModalLabel">操作提示</h5>--%>
<%--            </div>--%>
<%--            <div class="modal-body">--%>
<%--                <input hidden id="del">--%>
<%--                确认当前操作--%>
<%--            </div>--%>
<%--            <div id="opinfo" class=" modal-footer">--%>
<%--                <button type="button" class="confirm btn btn-primary btn-success" data-dismiss="modal" id="delConifm">--%>
<%--                    确认--%>
<%--                </button>--%>
<%--                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>--%>
<%--            </div>--%>
<%--        </div>--%>
<%--    </div>--%>
<%--</div>--%>
<%--<!-- 商品删除提示 -->--%>

<script type="text/javascript" src="${pageContext.request.contextPath}/warehouse/js/stock.js"></script>
</body>
</html>

